home *** CD-ROM | disk | FTP | other *** search
/ PC Media 4 / PC MEDIA CD04.iso / share / prog / gcoope10 / kern10.txt < prev    next >
Encoding:
Text File  |  1994-07-21  |  90.1 KB  |  2,444 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                              GCOOPE Version 1.0
  18.  
  19.      Generic C-language Object Oriented Programming Extension Version 1.0
  20.  
  21.                              by Brian Lee Price  
  22.  
  23.                     Released as Public Domain July, 1994
  24.  
  25.  
  26.  
  27.                                    Table of Contents
  28.  
  29.  
  30.             I. Introduction...............................................1
  31.                What is PCOOPE ?
  32.  
  33.  
  34.            II. Version 1.0 Ancestory......................................2
  35.                Design goals
  36.  
  37.  
  38.            III. The Kernel System.........................................3
  39.                 Overview
  40.  
  41.                 A. List manager...........................................3
  42.                    List based nature of version 3.1
  43.  
  44.                 B. Object list............................................3
  45.                    The object tracking system
  46.  
  47.                 C. Generic function list..................................4
  48.                    Generic (virtual) function database
  49.  
  50.                 D. The garbage collector and memory management shells.....5
  51.                    Temporary object management
  52.  
  53.                 E. Function dispatcher module.............................6
  54.                    with instance memory management
  55.  
  56.                 F. The pseudo class 'Object'..............................6
  57.                    Default method installation
  58.  
  59.                 G. The pseudo class 'Class'...............................7
  60.                    Class system installation
  61.  
  62.                 H. Other planned pseudo classes...........................7
  63.                    Extending the kernel
  64.  
  65.  
  66.            IV. High Level Data Structures.................................7
  67.                Dynamic structures in the PCOOPE kernel
  68.  
  69.                A. Object handles..........................................7
  70.                B. Instance Data Block.....................................8
  71.                C. Class Definition Data Block.............................9
  72.  
  73.             V. Kernel Theory of Operation................................11
  74.                By module and function
  75.  
  76.                A. listmgr.c module.......................................11
  77.                   1. addItem.............................................11
  78.                      Private Function
  79.  
  80.                   2. rmvItem.............................................12
  81.                      Private Function
  82.  
  83.                   3. compactList.........................................12
  84.                      Private Function
  85.  
  86.                                            i
  87.  
  88.  
  89.  
  90.                B. objlist.c module.......................................13
  91.                   1. getObject...........................................13
  92.                      Private Function
  93.  
  94.                   2. getObjDef...........................................14
  95.                      Private Function
  96.  
  97.                   3. addObject...........................................14
  98.                      Private Function
  99.  
  100.                   4. rmvObject...........................................15
  101.                      Private Function
  102.  
  103.                C. generic.c module.......................................15
  104.                   1. tagCmp..............................................16
  105.                      Public Function
  106.  
  107.                   2. addGeneric..........................................16
  108.                      Private Function
  109.  
  110.                   3. rmvGeneric..........................................16
  111.                      Private Function
  112.  
  113.                   4. getMthd.............................................17
  114.                      Private Function
  115.  
  116.                   5. addMethod...........................................17
  117.                      Private Function
  118.  
  119.                   6. rmvMethod...........................................17
  120.                      Private Function
  121.  
  122.                D. garbage.c module.......................................18
  123.                   1. garbage.............................................18
  124.                      Private Function
  125.  
  126.                   2. makePerm............................................19
  127.                      Public Function
  128.  
  129.                   3. outOfElems..........................................19
  130.                      Private Function
  131.  
  132.                   4. s_calloc............................................19
  133.                      Public Function
  134.  
  135.                   5. s_free..............................................20
  136.                      Public Function
  137.  
  138.                   6. s_malloc............................................20
  139.                      Public Function
  140.  
  141.                   7. s_realloc...........................................20
  142.                      Public Function
  143.  
  144.                E. funcdisp.c module......................................21
  145.                   1. g...................................................21
  146.                      Public Function
  147.  
  148.                                           ii
  149.  
  150.  
  151.  
  152.                   2. steer...............................................22
  153.                      Public Function
  154.  
  155.                   3. getIVptr............................................22
  156.                      Public Function
  157.  
  158.                   4. initInst............................................23
  159.                      Private Function
  160.  
  161.                   5. makeInst............................................23
  162.                      Public Function
  163.  
  164.                   6. getCVptr............................................24
  165.                      Public Function
  166.  
  167.  
  168.            VI. Pseudo Class Descriptions.................................25
  169.                Definition of pseudo class
  170.  
  171.                A. Object pseudo class module.............................25
  172.                   1. Object_Install......................................25
  173.                      Public Function
  174.  
  175.                   2. kill................................................26
  176.                      Default method for Kill generic
  177.  
  178.                   3. err.................................................27
  179.                      Default method for Err generic
  180.  
  181.                   4. getClassOf..........................................27
  182.                      default for classOf generic
  183.  
  184.                   5. getIVsize...........................................28
  185.                      default for ivSize generic
  186.  
  187.                   6. defRespondsTo.......................................28
  188.                      default for respondsTo generic
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.                                           iii
  211.  
  212.  
  213.  
  214.  
  215.  
  216.                           GCOOPE Version 1.0 SDK Debug Kernel
  217.  
  218.                               Technical Reference Manual
  219.  
  220.                          Written by Brian Lee Price, July 1994
  221.  
  222.  
  223.  
  224.            I. Introduction
  225.  
  226.  
  227.                      What is GCOOPE ?  Every few days I ask myself this
  228.                 question, and I always come up with a different answer.
  229.                 Originally conceived and designed as an object oriented
  230.                 programming extension to the C programming language,
  231.                 GCOOPE's inherent flexibility makes it something more.
  232.  
  233.                      GCOOPE is an experimental/educational Object Oriented
  234.                 Programming environment for standard ANSI C.  While the
  235.                 following paragraphs will mention a number of possible
  236.                 futures for the package, much work needs to be done in
  237.                 co-operation with the user's group before it achieves even a
  238.                 fraction of its potential.  In truth, the structure of
  239.                 GCOOPE may not prove itself to be suitable for commercial
  240.                 applications.  In the meantime, or in any case, it is an
  241.                 instructive exploratory framework for experimentation and
  242.                 research into the OOP world.
  243.  
  244.                      Is it SmallTalk for C ?  Not without a preprocessor it
  245.                 isn't, but it is similar.  It is worth noting that many
  246.                 Smalltalk techniques will work quite well in the GCOOPE
  247.                 framework.
  248.  
  249.                      Is it an operating system ?  Well, it is an operating
  250.                 system for objects, but no it doesn't have the potential to
  251.                 be a true operating system.  (Yet, I will admit to
  252.                 daydreaming about a GCOOPE accelerator in hardware. :).
  253.  
  254.                      Is it an applications framework ?  It could become one
  255.                 once it has been ported to enough systems and appropriate
  256.                 platform dependant expansion modules are written to a
  257.                 standardized interface, after all, portability is a key
  258.                 issue.
  259.  
  260.                      Is it a system resource ?  Well, not right now, but if
  261.                 you encapsulated the kernel as a DLL (or similar construct)
  262.                 and provided instantized kernel memory,...or GCOOPE on a
  263.                 MACH kernel ?
  264.  
  265.                      One of my main concerns in designing and writing GCOOPE
  266.                 is not to arbitarily close the door to any expansion
  267.                 possibility.  The last word on what GCOOPE is will be
  268.                 written in the future.  In the meantime, explore....
  269.  
  270.  
  271.  
  272.                                            1
  273.  
  274.  
  275.            II. Version 1.0 Ancestory
  276.  
  277.  
  278.                      Version 1.0 of the GCOOPE system has been designed to
  279.                 correct some deficiencies in PCOOPE version 2.1 and 3.0, as
  280.                 well as to better support advanced features.  The primary
  281.                 design goals have been:
  282.  
  283.                      1.  Ease of use.
  284.                      2.  Kernel modularity.
  285.                      3.  Kernel expandability.
  286.                      4.  Future dynamic linking and loading support.
  287.                      5.  Future multi-tasking support.
  288.                      6.  Increased flexibility.
  289.                      7.  Memory efficiency.
  290.  
  291.                     Fortunately, a number of these goals go hand in hand.  I
  292.                 adopted a few early strategies to achieve these goals.  A
  293.                 modular kernel (written correctly) is an expandable one. An
  294.                 expandable kernel lends itself to implementing flexible
  295.                 approaches.  Encapsulation of the kernel and class
  296.                 definitions make it easier to support dynamic linking and
  297.                 loading.  A side effect (or a method of) encapsulation is a
  298.                 simpler interface which (hopefully) will make the package
  299.                 easier to use.
  300.  
  301.                     A glaring shortcoming of PCOOPE version 2.1 was its poor
  302.                 memory efficiency.  Another related problem was that of
  303.                 memory fragmentation.  GCOOPE Version 1.0 does much to
  304.                 remedy the situation:
  305.  
  306.                      1.  'Flag' classes normally require no instance
  307.                           variable memory.
  308.  
  309.                      2.  Instance variable memory is concatenated, ie. the
  310.                           inherited instance variable memory is included in
  311.                           the owning instance memory block.
  312.  
  313.                      3.  All internal tracking data is maintained in dynamic
  314.                           tables, these tables are always a multiple of a
  315.                           minimum number of elements in size.  This reduces
  316.                           the need for reallocs and the resulting
  317.                           fragmentation.
  318.  
  319.                      In summary, although the basic nature of GCOOPE remains
  320.                 the same as the PCOOPE system, this implementation has an
  321.                 overhauled design approach.  If you liked the concept behind
  322.                 PCOOPE, you'll be suitably impressed by GCOOPE.
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                                            2
  335.  
  336.  
  337.            III. The Kernel System
  338.  
  339.  
  340.                 A. List manager.
  341.  
  342.                           Version 1.0 is based on lists.  Central to this
  343.                      approach is the list manager.  The list manager in V1.0
  344.                      is a cross between traditional fixed element size list
  345.                      management techniques and a partial implementation of a
  346.                      memory manager.
  347.  
  348.                           Each list has a header structure detailed in
  349.                      gcstruct.h. These headers maintain the current pointer
  350.                      to the dynamically allocated list, the size of the
  351.                      list's elements, the maximum number of elements in the
  352.                      currently allocated list size, and a dual purpose index
  353.                      to the first free element slot.
  354.  
  355.                           The list manager (source code in listmgr.c) is
  356.                      suitable for ordered or unordered lists.  It has three
  357.                      routines (addItem, rmvItem, and compactList) and is
  358.                      self-initializing.  This simple approach allows the
  359.                      code to be re-used many times in the kernel.  The
  360.                      manner in which the list manager is implemented also
  361.                      makes it suitable for maintaining lists of lists.
  362.  
  363.                           There are two major lists in V1.0; the object
  364.                      list, and the generic function list of lists.  The
  365.                      object list is a simple unordered list, and the generic
  366.                      function list of lists is an unordered list of lists
  367.                      ordered by class tag.
  368.  
  369.  
  370.                 B. Object list.
  371.  
  372.                           It really makes no difference conceptually whether
  373.                      objects are referenced by a pointer to a memory
  374.                      location or by an index to a table.  Previous versions
  375.                      of GCOOPE used the pointer approach, while workable, it
  376.                      directly led to many of the memory problems.  Version
  377.                      1.0 uses the index approach, the object list is a
  378.                      dynamic table of objectEntry type structures.  These
  379.                      structures contain a pointer to the object's memory,
  380.                      the ID of the process they belong to, and a use
  381.                      indicator used by the garbage collector to determine
  382.                      which objects can safely be deleted.
  383.  
  384.                           The object list doubles as the garbage collector
  385.                      buffer, so in reality, compared to earlier approaches,
  386.                      this approach uses very little additional memory.  In
  387.                      fact, due to the organization of the instance memory
  388.                      blocks, it uses quite a bit less.
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.                                            3
  397.  
  398.  
  399.                           I should point out here that although the type
  400.                      object, which is used as the object handle, is 32 bits
  401.                      or more in size, only 15 bits are available for object
  402.                      table indexing.  In both the source code and the
  403.                      documentation, you will see many references to 'tag'
  404.                      value.  This is simply the least significant 16 bits of
  405.                      the object handle.
  406.  
  407.  
  408.                 C. Generic function list
  409.  
  410.                           The basic list of generic functions is very
  411.                      similar to the object list, each entry contains a
  412.                      generic function tag value (used as the index), an
  413.                      optional default method address, and a pointer to a
  414.                      dynamically sized list of methods for that function,
  415.                      indexed by class tag.  Each entry in the list of
  416.                      methods has a second class tag called owner.  This
  417.                      owner tag is used by the current instance tracking
  418.                      mechanism, it is the class tag of the class for which
  419.                      the method is defined rather than inherited.
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.                                            4
  459.  
  460.  
  461.                           The default method may be called explicitly by
  462.                      passing the class handle Object as the first parameter.
  463.                      Otherwise, if no class method exists for the calling
  464.                      class in the called generic function, and if a default
  465.                      method exists, it will be called.  More detail on the
  466.                      actual use of the polyList will appear in the section
  467.                      on the function dispatcher.
  468.  
  469.                 D. The garbage collector and memory management shells
  470.  
  471.                           In V1.0 the garbage collector is very similar to
  472.                      the PCOOPE system in V2.1, the only real differences
  473.                      are the use of the object list instead of a dedicated
  474.                      buffer, the addition of process ID awareness, and the
  475.                      direct interface with the memory management shell
  476.                      routines.
  477.  
  478.                           There are a number of good reasons to use memory
  479.                      management shells with the GCOOPE system.  Number one
  480.                      is the need for co-operation between the garbage
  481.                      collector and the memory management functions, next is
  482.                      the effect of eliminating the need for checking the
  483.                      return pointer for a NULL pointer condition.  As long
  484.                      as the operation of the default error handler is not
  485.                      modified, a NULL pointer will never be returned.  The
  486.                      most subtle reason is to provide a one stop shop for
  487.                      upgrade to an aftermarket memory manager library.
  488.  
  489.                           When you examine the source code for the garbage
  490.                      collector system, you will see references to the
  491.                      adaptive nature of the garbage collector routine.
  492.                      Basically, depending on the setting of certain
  493.                      constants in gcstruct.h, the garbage collector has two
  494.                      distinct modes.  In the normal mode, the garbage
  495.                      collector only examines a few entries in the list each
  496.                      time it is called and it only subtracts a small value
  497.                      from the last access variable.  As the counter timeVal
  498.                      times out, the garbage collector control variables will
  499.                      be set to a slower pace, when a memory error occurs,
  500.                      they will be set to a faster rate.  In the memory error
  501.                      mode the garbage collector no longer pays any attention
  502.                      to the process ID (except for the permanent process ID)
  503.                      and runs at the maximum values allowed by the constant
  504.                      settings.
  505.  
  506.                           In effect, the garbage collector system operates
  507.                      probabilistically, with the adaptive algorithm
  508.                      approximating a first order low pass filter.  As far as
  509.                      overall processing time is concerned, there are many
  510.                      more efficient approaches, but because the garbage
  511.                      collector operates much like a background task, the
  512.                      overall effect is much quicker in operation than most
  513.                      other algorithms.  (Plus its simple.)
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.                                            5
  521.  
  522.  
  523.                 E. Function dispatcher module
  524.  
  525.                           In PCOOPE Version 2.1 I hid the function
  526.                      dispatcher behind macros and used a number of of global
  527.                      variables to track methods for each generic function.
  528.                      This proved cumbersome in practice, with GCOOPE the
  529.                      function dispatcher is out in the open (so to speak)
  530.                      and the entire generic function tracking system is
  531.                      implemented via the generic function list.
  532.  
  533.                           The function dispatcher takes a generic type
  534.                      parameter and through some creative use of the va_...
  535.                      function/macro accesses the first parameter in the call
  536.                      to the method.  The first parameter in a method call is
  537.                      always of type object and is the object handle for the
  538.                      instance or class being operated on.  The function
  539.                      dispatcher gets the list indexed by the generic
  540.                      parameter and looks up the class of the object handle,
  541.                      if a match is found it will adjust the object handle to
  542.                      point to the correct instance and return the method.
  543.                      However if either the object handle is equal to
  544.                      'Object' or no match is found, the method returned will
  545.                      be that of the default method.  If no default method is
  546.                      registered for the generic function being accessed the
  547.                      method returned will be that of the default error
  548.                      handler.
  549.  
  550.                           Without going into too much detail (this IS
  551.                      supposed to be an overview), the function dispatcher
  552.                      and memory access system has been completely overhauled
  553.                      from the PCOOPE approach.  The index to the object
  554.                      table, along with a current instance offset, and a flag
  555.                      class value are all compacted in a 32 bit object
  556.                      handle.  The instance memory block has been
  557.                      concatenated.  In other words all ancestor instances
  558.                      are part of the same memory block as the owning class
  559.                      instance.
  560.  
  561.                           Routines are provided in this module to access the
  562.                      instance and class variables as well as to create an
  563.                      instance block.  There is also a routine dedicated to
  564.                      updating the current instance pointer, normally this is
  565.                      done automatically, however in certain cases it must be
  566.                      called directly.  (Cases such as inside a New, Kill, or
  567.                      Err method).
  568.  
  569.  
  570.                 F. The pseudo class 'Object'
  571.  
  572.                           Because the class mechanism has not yet been
  573.                      installed prior to installation of 'Object', 'Object'
  574.                      installs itself using low level kernel functions.  In
  575.                      fact, 'Object' is not a true class because its methods
  576.                      are installed as the default methods for the
  577.                      generictions it loads.  You should not inherit
  578.                      'Object', its methods are always available.
  579.  
  580.  
  581.  
  582.                                            6
  583.  
  584.  
  585.                 G. The pseudo class 'Class'
  586.  
  587.                           Similar to 'Object', 'Class' installs using low
  588.                      level kernel functions.  'Class' actually is a true
  589.                      class with methods that are installed as generic
  590.                      methods, however, there is no point to inheriting the
  591.                      class 'Class' since it only deals with the process of
  592.                      installing a class definition object into the GCOOPE
  593.                      kernel.  Once 'Class' has been loaded, normal class
  594.                      definitions may be installed.
  595.  
  596.  
  597.                 H. Other planned pseudo classes
  598.  
  599.                           Using the techniques and methods used by and made
  600.                      available through 'Object' and 'Class' it is possible
  601.                      to install other pseudo class modules for the purpose
  602.                      of extending the kernel and the pseudo-classes 'Object'
  603.                      and 'Class'.  Such extensions may be used to add
  604.                      dynamic loader/unloader capabilities, multi-tasking,
  605.                      platform GUI support, etc.
  606.  
  607.                           With the framework provided it is possible to add
  608.                      library functions, generic functions, methods and
  609.                      default methods to existing generic functions, and
  610.                      global variables.  All added functions and variables
  611.                      could be published and made available through an add on
  612.                      symbol list manager for dynamic loading support.
  613.  
  614.  
  615.            IV. High Level Data Structures
  616.  
  617.  
  618.                 NOTE: in the following discussion, it is assumed that you
  619.                 have a hardcopy of the file gcstruct.h.
  620.  
  621.                 A. Object handles
  622.  
  623.                           The typedef for 'object' insures that its size
  624.                      will be at least 32 bits.  The type object is used in a
  625.                      variety of ways in GCOOPE, here we will examine the
  626.                      structure imposed on a variable of type object when it
  627.                      is used as an object handle.
  628.  
  629.                      ---------------------------------------
  630.                      | 31 FLAG | 30 FEXT 16 | 15   TAG   0 |
  631.                      ---------------------------------------
  632.  
  633.                                OBJECT HANDLE STRUCTURE
  634.  
  635.                           The actual structure definition for this structure
  636.                      is given in gcstruct.h as objHndl.
  637.  
  638.                      TAG is an index to the objList list for the object.  It
  639.                      may be accessed through the tag member of objHndl.
  640.  
  641.  
  642.  
  643.  
  644.                                            7
  645.  
  646.  
  647.                           FEXT is the offset from the start of the instance
  648.                      memory block to the current instance.  The current
  649.                      memory block is located at the address given by the
  650.                      objDef member of the objectEntry structure indexed by
  651.                      TAG.  FEXT may be accessed through the fext member of
  652.                      objHndl.
  653.  
  654.                      FLAG is cleared to 0 for classes and normal instances,
  655.                      for instances of special 'flag' classes which impose a
  656.                      custom structure onto the OBJECT HANDLE STRUCTURE, FLAG
  657.                      is set to 1.  When FLAG is set, FEXT is the actual
  658.                      class tag value.  These flag classes either have no
  659.                      instance variables or they use the object handle for
  660.                      instance variable storage.
  661.  
  662.                           It should be noted that the type object is the
  663.                      default return type for methods.  You should cast the
  664.                      return value to the appropriate type.  The type object
  665.                      is capable of passing any data type of 32 bits or less
  666.                      in size.
  667.  
  668.  
  669.                 B. Instance Data Block
  670.  
  671.                           The basic structure of an instance data block is
  672.                      simple, it consists of an integer class tag value
  673.                      followed by a variable number of bytes where the
  674.                      instance data can be/is stored.  If the class of an
  675.                      instance inherits other classes, those instance data
  676.                      blocks will be appended to the end of the owning
  677.                      instance data block.  Where it gets a bit complicated
  678.                      is the common case where the inherited class instance
  679.                      data block has its own inherited instance data blocks
  680.                      appended.
  681.  
  682.                           The following is a graphical explanation of the
  683.                      instance data block structure for the three cases
  684.                      described:
  685.  
  686.                      -----------------
  687.                      | class tag     |
  688.                      -----------------   BASIC INSTANCE BLOCK
  689.                      | instance vars |
  690.                      -----------------
  691.  
  692.                      -------------------------
  693.                      | owning class tag      |
  694.                      -------------------------
  695.                      | instance vars         |     INSTANCE BLOCK WITH
  696.                      -------------------------
  697.                      | inherited class 1 tag |        TWO ANCESTORS
  698.                      -------------------------
  699.                      | instance vars         |
  700.                      -------------------------
  701.                      | inherited class 2 tag |
  702.                      -------------------------
  703.                      | instance vars         |
  704.                      -------------------------
  705.  
  706.                                            8
  707.  
  708.  
  709.  
  710.                      -----------------------------
  711.                      | owning class tag          |
  712.                      -----------------------------
  713.                      | instance vars             |
  714.                      -----------------------------
  715.                      | parent 1 class tag        |     INSTANCE BLOCK WITH
  716.                      -----------------------------
  717.                      | instance vars             |     TWO ANCESTORS, EACH
  718.                      -----------------------------
  719.                      | grandparent 1-1 class tag |     WITH TWO ANCESTORS OF
  720.                      -----------------------------
  721.                      | instance vars             |     THEIR OWN
  722.                      -----------------------------
  723.                      | grandparent 1-2 class tag |
  724.                      -----------------------------
  725.                      | instance vars             |
  726.                      -----------------------------
  727.                      | parent 2 class tag        |
  728.                      -----------------------------
  729.                      | instance vars             |
  730.                      -----------------------------
  731.                      | grandparent 2-1 class tag |
  732.                      -----------------------------
  733.                      | instance vars             |
  734.                      -----------------------------
  735.                      | grandparent 2-2 class tag |
  736.                      -----------------------------
  737.                      | instance vars             |
  738.                      -----------------------------
  739.  
  740.                           Additional levels of inheritance follow the rules
  741.                      described and implied in the above.
  742.  
  743.  
  744.                 C. Class Definition Data Block
  745.  
  746.                           As you can see from the above, while the layout of
  747.                      the instance data blocks is straight forward, keeping
  748.                      track of it is not.  This is the job of the class
  749.                      definition data block.  Rather than reprinting the
  750.                      relevant portions of gcstruct.h, I'll refer you to them
  751.                      as needed in the following explanation.
  752.  
  753.                           The first entry in a class definition data block
  754.                      is always a classEntry type structure (described in
  755.                      gcstruct.h).  The first member of that structure
  756.                      (class) is set equal to the class tag value.  Member
  757.                      cvSize is set to the size of the class variables data
  758.                      area that is shared by all instances of the class.
  759.                      Member ivSize is the size of the class's own instance
  760.                      variables and totSize is the total size of an instance
  761.                      data block for that class (this includes inherited
  762.                      instance data blocks).
  763.  
  764.  
  765.  
  766.  
  767.  
  768.                                            9
  769.  
  770.  
  771.                           The numSuper member is the number of immediate
  772.                      superClasses inherited (parents). Member numMthds is
  773.                      the number of defined (not inherited) method functions
  774.                      for the class, while member  cVars is the beginning of
  775.                      the class variables storage area.
  776.  
  777.                           The next area is comprised of numSuper's worth of
  778.                      superEntry structures (see gcstruct.h) and is the data
  779.                      storage area for the instance tracking mechanism.  Each
  780.                      entry consists of a class tag value and the offset from
  781.                      the start of the child class's instance memory block
  782.                      where the superClass instance memory block begins.
  783.  
  784.                           Note that the class member of a superClass entry
  785.                      will match the class tag value located at the given
  786.                      offset within the child instance block.  To remain
  787.                      memory efficient, only the immediate parents are
  788.                      listed, however because of the layout of the instance
  789.                      memory block(s), you can find the offset for a
  790.                      great-great-...etc. grandparent instance simply by
  791.                      adding the offsets for each successive parent in the
  792.                      direct lineage.
  793.  
  794.                           The tail end of the class definition data block is
  795.                      the method data area.  This area begins at the end of
  796.                      the superEntry list.  It consists of numMthds worth of
  797.                      methodEntry type structures (see gcstruct.h), each
  798.                      entry contains the generic index value of the generic
  799.                      function through which the method is accessed, and the
  800.                      address of the method function.  This area is primarily
  801.                      used for inheritance purposes although it could play a
  802.                      roll in dynamically unloading a class.
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.                                           10
  831.  
  832.  
  833.            V. Kernel Theory of Operation
  834.  
  835.                      In the following descriptions, Private Function means
  836.                 that the functions is meant to be called only from within
  837.                 the kernel.  Public Function indicates that it will be made
  838.                 available to applications programs.
  839.  
  840.  
  841.                 A. listmgr.c module
  842.  
  843.                           As noted it the Overview, version 1.0 is based on
  844.                      lists.  Basic list management is performed by the
  845.                      listmgr module.  In the following discussion, please
  846.                      refer to the DYNLIST_STRU macro and the dynList
  847.                      structure typedef in gcstruct.h.  The dynList structure
  848.                      (and all structures beginning with the DYNLIST_STRU
  849.                      macro) has (at least) the following members:
  850.  
  851.                      elemSize - this is the size in bytes of an element of
  852.                                the list.
  853.  
  854.                      firstFree - the index value of the first unused slot
  855.                                (element) in the list.
  856.  
  857.                      maxElems - the maximum number of elements in the
  858.                                current list size.
  859.  
  860.                      listPtr - a pointer to the actual list.  Note: the
  861.                                functions in listmgr will alter the address
  862.                                stored here so it should not be locally
  863.                                stored.
  864.  
  865.                           The listmgr module contains three functions;
  866.                      addItem, rmvItem, and compactList.  Their operation is
  867.                      detailed below.
  868.  
  869.                      1. addItem
  870.  
  871.                           usage:
  872.                                newItemIndex=addItem(listControlStrucAdr,
  873.                                                         elemSize);
  874.  
  875.                           error value: returns -1 on error.
  876.  
  877.                           prototype:
  878.  
  879.                                int addItem(void *, int);
  880.  
  881.                                This routine adds an item to a list control
  882.                           structure whose first structure elements are
  883.                           equivalent to a dynList structure.  If the member
  884.                           listPtr is NULL, the list will be created and
  885.                           initialized.  Note that the size of a list
  886.                           created/managed always has the maxElems equal to a
  887.                           multiple of the constant MIN_LIST_ADD.  The actual
  888.                           size of the list is given by elemSize times
  889.                           maxElems.
  890.  
  891.  
  892.                                           11
  893.  
  894.  
  895.                                If on entry, firstFree is equal to or greater
  896.                           than maxElems, the list will be increased in size
  897.                           by MIN_LIST_ADD elements.  The structure member
  898.                           firstFree will be set to the next unused element
  899.                           in the list and the index value of the new element
  900.                           will be returned.  In order to be considered
  901.                           unused, an element slot must contain all zeros.
  902.                           This is a private kernel function.
  903.  
  904.  
  905.                      2. rmvItem
  906.  
  907.                           usage:
  908.  
  909.                                nextFree=rmvItem(listControlStrucAdr,
  910.                                                         elementIndex);
  911.  
  912.                           error value: returns -1 on error.
  913.  
  914.                           prototype:
  915.  
  916.                                int rmvItem(void *, int);
  917.  
  918.                                This routine frees up a previously occupied
  919.                           slot, it does not reduce the total list size.  The
  920.                           element freed will be zeroed out, and if the freed
  921.                           element index is less than the current firstFree,
  922.                           firstFree will be set to the index of the freed
  923.                           element.  Normally, this routine returns the new
  924.                           firstFree.  This is a private kernel function.
  925.  
  926.  
  927.                      3. compactList
  928.  
  929.                           usage:
  930.  
  931.                                status=compactList(listControlStrucAdr,
  932.                                                         booleanSorted);
  933.  
  934.                           error value: returns FUNCFAIL on error.
  935.  
  936.                           prototype:
  937.  
  938.                                stat compactList(void *, boolean);
  939.  
  940.                                This routine attempts to free up unused
  941.                           memory in a list.  The boolean type booleanSorted
  942.                           when true tells the routine that it may perform
  943.                           the compaction operation, squeezing out unused
  944.                           slots.  This compaction process should only be
  945.                           done on sorted lists because an indexed list would
  946.                           become un-indexed.
  947.                                Regardless of whether or not the list has
  948.                           been compacted, this routine will check to see if
  949.                           enough empty slots exist at the top of the list to
  950.                           justify reallocating it.  This is a private kernel
  951.                           function.
  952.  
  953.  
  954.                                           12
  955.  
  956.  
  957.                 B. objlist.c module
  958.  
  959.                           This module provides the object database routines
  960.                      for the kernel.  Each object (with certain specific
  961.                      exceptions, namely the flag class instances) that is
  962.                      active will have an entry in the objList structure's
  963.                      list.  These entries conform to the structure typedef'd
  964.                      as objectEntry.  This structure has three entries:
  965.  
  966.                      objDef - a pointer to the object's memory block.
  967.  
  968.                      procID - the process ID number of the process that
  969.                                created the object.
  970.  
  971.                      lastAcc - a use indicator used by the garbage
  972.                                collector.
  973.  
  974.                           Note that the list maintained in the objList
  975.                      control structure is an unordered list.  The entries
  976.                      are located by the object handle tag values which are
  977.                      indices to the list.  The objlist.c module contains
  978.                      four functions; getObject, getObjDef, addObject, and
  979.                      rmvObject.  These functions are detailed below.
  980.  
  981.  
  982.                      1. getObject
  983.  
  984.                           usage:
  985.  
  986.                                objectEntryPtr=getObject(object_tag_value);
  987.  
  988.                           error value: returns NULL on error.
  989.  
  990.                           prototype:
  991.  
  992.                                objectEntry * getObject(int);
  993.  
  994.                                This routine returns the pointer to a
  995.                           structure objectEntry in the list maintained in
  996.                           objList at the index equal to the tag value
  997.                           object_tag_value.  This is a private kernel
  998.                           function.
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.                                           13
  1017.  
  1018.  
  1019.                      2. getObjDef
  1020.  
  1021.                           usage:
  1022.  
  1023.                                objDefinitionPtr=getObjDef(object_tag_value);
  1024.  
  1025.                           error value: returns NULL on error.
  1026.  
  1027.                           prototype:
  1028.  
  1029.                                void * getObjDef(int);
  1030.  
  1031.                                This routine returns a pointer to the actual
  1032.                           object definition instead of the objectEntry like
  1033.                           getObject.  Otherwise it is the same as getObject.
  1034.                           This is a private kernel function.
  1035.  
  1036.  
  1037.                      3. addObject
  1038.  
  1039.                           usage:
  1040.  
  1041.                                newObjTagValue=addObject(objectDefinitionPtr,
  1042.                                                              processID);
  1043.  
  1044.                           error value: returns BAD_OBJ on error.
  1045.  
  1046.                           prototype:
  1047.  
  1048.                                int addObject(void *, unsigned char);
  1049.  
  1050.                                The value processID is used to enable the
  1051.                           garbage collection mechanism to be multi-thread
  1052.                           aware, it is also used by makePerm and in newClass
  1053.                           to prevent the garbage collector from killing off
  1054.                           non-temporary objects by setting the value to
  1055.                           PERM_PROC_ID.
  1056.  
  1057.                                The object definition pointer must be a valid
  1058.                           pointer to an actual object definition.  The
  1059.                           return value is the tag value of the new object.
  1060.                           This is a private kernel function.
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.                                           14
  1079.  
  1080.  
  1081.                      4. rmvObject
  1082.  
  1083.                           usage:
  1084.  
  1085.                                functionStatus=rmvObject(object_tag_value);
  1086.  
  1087.                           error value: returns FUNCFAIL on error.
  1088.  
  1089.                           prototype:
  1090.  
  1091.                                int rmvObject(int);
  1092.  
  1093.                                This function removes an object Entry from
  1094.                           the objList after freeing the object definition
  1095.                           memory area pointed to by objDef (if it is !=
  1096.                           NULL).  It returns FUNCOKAY if no error.  This is
  1097.                           a private function.
  1098.  
  1099.  
  1100.  
  1101.                 C. generic.c module.
  1102.  
  1103.                           This module tracks the generic functions and their
  1104.                      methods.  They are maintained in an unordered list of
  1105.                      generic functions, with each generic function entry
  1106.                      having an associated pointer to an ordered lists of
  1107.                      methods.  The generic function entries are contained in
  1108.                      structures of type genEntry.  Note that genEntry
  1109.                      structures begin with the DYNLIST_STRU macro, this
  1110.                      means that they have the same capabilities as a dynList
  1111.                      structure in regards to the routines in listmgr.c.
  1112.  
  1113.                           In addition, these structures have a member
  1114.                      defMthd, used to store the (optional) default method
  1115.                      address.
  1116.  
  1117.                          The method lists for each generic function are
  1118.                      comprised of genMethod type structures.  These
  1119.                      structures are sorted according to their first member
  1120.                      'class'.  This member is the class tag of the owning
  1121.                      instance in calls to the function dispatcher.  The next
  1122.                      member, owner, is the class tag of the class for which
  1123.                      the method is defined rather than inherited.  This
  1124.                      member is used by the instance tracking mechanism to
  1125.                      insure correct instance referencing.
  1126.  
  1127.                           The last member of the structure is the address of
  1128.                      the associated method.  This module contains six
  1129.                      functions; intCmp, addGeneRic, rmvGeneRic, getMthd,
  1130.                      addMethod, and rmvMethod.  These functions are detailed
  1131.                      below.
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.                                           15
  1141.  
  1142.  
  1143.                      1. tagCmp
  1144.  
  1145.                           usage:
  1146.  
  1147.                                used by qsort, bsearch, etc type standard
  1148.                                          ANSI-C library functions.
  1149.  
  1150.                           error value: none.
  1151.  
  1152.                           prototype:
  1153.  
  1154.                                int tagCmp(void *, void *);
  1155.  
  1156.                                This function is a simple tag compare routine
  1157.                           designed for use with the standard library qsort,
  1158.                           bsearch, etc. routines.  This is a public
  1159.                           function.
  1160.  
  1161.  
  1162.                      2. addGeneric
  1163.  
  1164.                           usage:
  1165.  
  1166.                                newGenericIndex=addGeneric(symbolStringPtr,
  1167.                                                              defaultMethod);
  1168.  
  1169.                           error value: returns MAX_GEN on error.
  1170.  
  1171.                           prototype:
  1172.  
  1173.                                Generic addGeneric(char *, method);
  1174.  
  1175.                                This function adds a new Generic function to
  1176.                           the genList.  It also installs the defaultMethod
  1177.                           for the new entry.  It returns the index value
  1178.                           (Generic tag) of the new entry which is used as
  1179.                           the handle to the Generic function in calls to the
  1180.                           function dispatcher.  This is a private kernel
  1181.                           function.
  1182.  
  1183.                      3. rmvGeneric
  1184.  
  1185.                           usage:
  1186.  
  1187.                                status=rmvGeneric(Generic_tag_of_func2rmv);
  1188.  
  1189.                           error value: returns -1 on error.
  1190.  
  1191.                           prototype:
  1192.  
  1193.                                int rmvGeneric(Generic);
  1194.  
  1195.                                This function attempts to remove the Generic
  1196.                           function indexed by Generic_tag_of_func2rmv.
  1197.                           Normally a non-zero positive number will be
  1198.                           returned.  This is a private kernel function.
  1199.  
  1200.  
  1201.  
  1202.                                           16
  1203.  
  1204.  
  1205.                      4. getMthd
  1206.  
  1207.                           usage:
  1208.  
  1209.                                genMethodPtr=getMthd(Generic_tag,
  1210.                                                              class_tag);
  1211.  
  1212.                           error value: returns NULL on error.
  1213.  
  1214.                           prototype:
  1215.  
  1216.                                genMethod * getMthd(Generic, int);
  1217.  
  1218.                                This function will lookup the correct Generic
  1219.                           function entry indexed by Generic_tag and do a
  1220.                           binary search for the genMethod entry in its
  1221.                           method list for class_tag.  It returns a pointer
  1222.                           to the genMethod type structure with a class entry
  1223.                           that matches class_tag.  This is a private kernel
  1224.                           function.
  1225.  
  1226.  
  1227.                      5. addMethod
  1228.  
  1229.                           usage:
  1230.  
  1231.                                status=addMethod(Generic_tag,method_address,
  1232.                                             class_tag, owning_class_tag);
  1233.  
  1234.                           error value: returns FUNCFAIL on error.
  1235.  
  1236.                           prototype:
  1237.  
  1238.                                int addMethod(Generic, method, int, int);
  1239.  
  1240.                                This function adds a method to the method
  1241.                           list of an existing Generic function.  It sorts
  1242.                           the list by class after filling in the new entry.
  1243.                           Normally this routine returns FUNCOKAY.  This is a
  1244.                           private kernel function.
  1245.  
  1246.  
  1247.                      6. rmvMethod
  1248.  
  1249.                           usage:
  1250.  
  1251.                                status=rmvMethod(Generic_tag, class_tag);
  1252.  
  1253.                           error value: returns FUNCFAIL on error.
  1254.  
  1255.                           prototype:
  1256.  
  1257.                                int rmvMethod(Generic, int);
  1258.  
  1259.                                This function will remove a previously
  1260.                           installed method from a Generic function's method
  1261.                           list.  It normally returns FUNCOKAY.  This is a
  1262.                           private kernel function.
  1263.  
  1264.                                           17
  1265.  
  1266.  
  1267.                 D. garbage.c module.
  1268.  
  1269.                           This module is home to the memory management
  1270.                      functions for the kernel.  It also provides for
  1271.                      automatic destruction of temporary objects as well as
  1272.                      the means to make a temporary object permanent.
  1273.  
  1274.                           There are seven functions in this module, garbage,
  1275.                      makePerm, outOfElems, s_calloc, s_free, s_malloc, and
  1276.                      s_realloc.  They are described below.
  1277.  
  1278.                      1. garbage
  1279.  
  1280.                           usage:
  1281.  
  1282.                                garbage();
  1283.  
  1284.                           error value: none.
  1285.  
  1286.                           prototype:
  1287.  
  1288.                                static void garbage(void);
  1289.  
  1290.                                This function is a round-robin style garbage
  1291.                           collector routine with adaptive features.  It
  1292.                           searches the objList for unused objects and calls
  1293.                           p(Kill)(... to delete them.  It is multi-process
  1294.                           aware, under normal circumstances, it will only
  1295.                           examine objects which belong to the currently
  1296.                           executing process.  When an out of memory (or out
  1297.                           of list space) condition occurs, it will kick into
  1298.                           high gear and ignores process IDs.
  1299.  
  1300.                                The algorithm is adaptive, a use-based timer
  1301.                           is employed, on time-out the algorithm will be
  1302.                           reset to slower values.  At the end of an out of
  1303.                           memory condition, it will reset to faster values.
  1304.                           To gain a full understanding of this function, it
  1305.                           is recommended that you examine the source code in
  1306.                           detail.  A full discussion of its operation would
  1307.                           require a separate document.  This is a private
  1308.                           kernel function.
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.                                           18
  1327.  
  1328.  
  1329.                      2. makePerm
  1330.  
  1331.                           usage:
  1332.  
  1333.                                status=makePerm(object_handle);
  1334.  
  1335.                           error value: FUNCFAIL is returned on an error.
  1336.  
  1337.                           prototype:
  1338.  
  1339.                                int makePerm(object);
  1340.  
  1341.                                This function makes a temporary object into a
  1342.                           permanent one, thereby disallowing access to it by
  1343.                           the garbage collector function.  FUNCOKAY is
  1344.                           normally returned.  This is a public function.
  1345.  
  1346.  
  1347.                      3. outOfElems
  1348.  
  1349.                           usage:
  1350.  
  1351.                                outOfElems();
  1352.  
  1353.                           error value: none.
  1354.  
  1355.                           prototype:
  1356.  
  1357.                                void outOfElems(void);
  1358.  
  1359.                                This function basically fakes an out of
  1360.                           memory condition and calls the garbage collector.
  1361.                           It is provided for the unlikely event that the
  1362.                           objList runs out of list memory space.  It is also
  1363.                           used by the s_... functions to avoid code
  1364.                           duplication.  This is a private kernel function.
  1365.  
  1366.  
  1367.                      4. s_calloc
  1368.  
  1369.                           usage:
  1370.  
  1371.                                newBlockPtr=s_calloc(numItems, itemSize);
  1372.  
  1373.                           error value: returns NULL if default error routine
  1374.                                               returns instead of aborts.
  1375.  
  1376.                           prototype:
  1377.  
  1378.                                void * s_calloc(unsigned, unsigned);
  1379.  
  1380.                                This routine is used exactly like the
  1381.                           standard ANSI-C library routine calloc.  Unlike
  1382.                           the standard routine, this routine interfaces
  1383.                           directly with the garbage collector.  Returns a
  1384.                           pointer to a dynamically allocated block of memory
  1385.                           of size numItems*itemSize.  The new block will be
  1386.                           cleared to all zeros.  This is a public function.
  1387.  
  1388.                                           19
  1389.  
  1390.  
  1391.                      5. s_free
  1392.  
  1393.                           usage:
  1394.  
  1395.                                s_free(oldBlock);
  1396.  
  1397.                           error value: none.
  1398.  
  1399.                           prototype:
  1400.  
  1401.                                void s_free(void *);
  1402.  
  1403.                                This routine is mostly provided for
  1404.                           completeness, it behaves exactly as the standard
  1405.                           library free().  This is a public function.
  1406.  
  1407.  
  1408.                      6. s_malloc
  1409.  
  1410.                           usage:
  1411.  
  1412.                                newBlockPtr=s_malloc(size);
  1413.  
  1414.                           error value: returns NULL if default error routine
  1415.                                                returns instead of aborts.
  1416.  
  1417.                           prototype:
  1418.  
  1419.                                void * s_malloc(unsigned);
  1420.  
  1421.                                This routine is used exactly like the
  1422.                           standard ANSI-C library routine malloc.  Unlike
  1423.                           the standard routine, this routine interfaces
  1424.                           directly with the garbage collector.  It returns a
  1425.                           pointer to a new dynamically allocated block of
  1426.                           memory of size 'size'.  This is a public function.
  1427.  
  1428.  
  1429.                      7. s_realloc
  1430.  
  1431.                           usage:
  1432.  
  1433.                                newBlockPtr=s_realloc(oldBlockPtr, oldSize);
  1434.  
  1435.                           error value: returns NULL if default error routine
  1436.                                                returns instead of aborts.
  1437.  
  1438.                           prototype:
  1439.  
  1440.                                void * s_realloc(void *, unsigned);
  1441.  
  1442.                                This routine is used exactly like the
  1443.                           standard ANSI-C library routine realloc.  Unlike
  1444.                           the standard routine, this routine interfaces
  1445.                           directly with the garbage collector.  It returns a
  1446.                           pointer to the relocated and resized block of
  1447.                           memory of size 'newsize'.  This is a public
  1448.                           function.
  1449.  
  1450.                                           20
  1451.  
  1452.  
  1453.                 E. funcdisp.c module.
  1454.  
  1455.                           This module is responsible for dispatching Generic
  1456.                      functions to the correct method, tracking the current
  1457.                      object instance, accessing class variables, and
  1458.                      creating/accessing instance variables.  This module
  1459.                      contains six functions; g, steer, getIVptr, initInst,
  1460.                      makeInst, and getCVptr.  They are described below.
  1461.  
  1462.  
  1463.                      1. g
  1464.  
  1465.                           usage:
  1466.  
  1467.                                methodReturnValue=g(GenericTag)(
  1468.                                                    object_handle,...);
  1469.  
  1470.                           error value: dispatches to the default error
  1471.                                          routine if an error occurs.
  1472.  
  1473.                           prototype:
  1474.  
  1475.                                method g(generic,...);
  1476.  
  1477.                                This routine dispatches the Generic function
  1478.                           indexed by GenericTag to the method in the method
  1479.                           list with a class equal to the tag value of
  1480.                           object_handle.  Due to the way C compiles the
  1481.                           statement given in usage, the method returned from
  1482.                           g will immediately be called upon the return from
  1483.                           g.  Another aspect of the function dispatcher g is
  1484.                           that it accesses the first parameter
  1485.                           (object_handle) in the call to the method.  In
  1486.                           most cases, g will update object_handle via a call
  1487.                           to steer.  This insures that further calls to
  1488.                           ancestor methods will be routed correctly and that
  1489.                           calls to getIVptr will return a pointer to the
  1490.                           correct instance memory block.
  1491.  
  1492.                                Normally, g will dispatch to the method that
  1493.                           corresponds to the class of the object_handle in
  1494.                           the method list maintained for the Generic
  1495.                           function indexed by GenericTag.  If a method for
  1496.                           that class does not exist, p will attempt to
  1497.                           return the default method, if no default method is
  1498.                           listed, the dispatcher will return the address of
  1499.                           the default error handler.
  1500.  
  1501.                                For further information about this complex
  1502.                           function, please consult the user's guide and
  1503.                           carefully study the provided source code.  If you
  1504.                           need further information or assistance contact me
  1505.                           via the GCOOPE USER'S GROUP.  This is a public
  1506.                           function.
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.                                           21
  1513.  
  1514.  
  1515.                      2. steer
  1516.  
  1517.                           usage:
  1518.  
  1519.                                updatedObjectHandle=steer(classObjectHandle,
  1520.                                               instanceObjectHandle);
  1521.  
  1522.                           error value: returns NULL on error.
  1523.  
  1524.                           prototype:
  1525.  
  1526.                                object steer(object, object);
  1527.  
  1528.                                This routine 'steers' the fext field of the
  1529.                           OBJECT HANDLE STRUCTURE to contain the offset
  1530.                           within the owning instance memory block referenced
  1531.                           by instanceObjectHandle for the class referenced
  1532.                           by classObjectHandle.  It normally returns the
  1533.                           updated object handle.
  1534.  
  1535.                                Most applications will never require this
  1536.                           function, however class definitions will make use
  1537.                           of it at least in the constructor method (New).
  1538.                           It will also be required for any destructor method
  1539.                           or error handling method.  In general, this
  1540.                           routine must be called directly any time you
  1541.                           attempt to call a method that is defined for both
  1542.                           the current object class and an ancestor object
  1543.                           class and you are trying to invoke the ancestor's
  1544.                           method.  Another place where it may be required is
  1545.                           when you use local method pointer caching (see the
  1546.                           user's guide).  This is a public function.
  1547.  
  1548.  
  1549.                      3. getIVptr
  1550.  
  1551.                           usage:
  1552.  
  1553.                                instancePtr=getIVptr(instanceObjectHandle);
  1554.  
  1555.                           error value: returns NULL on error.
  1556.  
  1557.                           prototype:
  1558.  
  1559.                                void * getIVptr(object);
  1560.  
  1561.                                This routine is used to access the current
  1562.                           instance memory area.  It gets the pointer to the
  1563.                           owning instance memory block, adds the fext value,
  1564.                           and adds the size of the first entry (an integer:
  1565.                           classTag).  It returns the adjusted pointer.  This
  1566.                           is a public function.
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.                                           22
  1575.  
  1576.  
  1577.                      4. initInst
  1578.  
  1579.                           usage:
  1580.  
  1581.                                status=initInst(class_tag, curOffset,
  1582.                                                              newBlockPtr);
  1583.  
  1584.                           error value: returns 0/NULL on error.
  1585.  
  1586.                           prototype:
  1587.  
  1588.                                object initInst(int, int, char *);
  1589.  
  1590.                                This routine is used by makeInst (see below)
  1591.                           to initialize a new instance memory block.  It is
  1592.                           a recursive function calling itself for each
  1593.                           immediate parent class of class_tag.
  1594.                           Initialization consists of writing the correct
  1595.                           class tag values at the correct offsets within the
  1596.                           new instance memory block.  Normally this routine
  1597.                           returns a non-zero value.  When examining the
  1598.                           source code for this routine, keep the previously
  1599.                           detailed description of the INSTANCE DATA BLOCK
  1600.                           close at hand.  This is a private kernel function.
  1601.  
  1602.  
  1603.                      5. makeInst
  1604.  
  1605.                           usage:
  1606.  
  1607.                                instancePtr=makeInst(
  1608.                                               ptrToInstanceObjectHandle);
  1609.  
  1610.                           error value: returns NULL on error.
  1611.  
  1612.                           prototype:
  1613.  
  1614.                                void * makeInst(object *);
  1615.  
  1616.                                This routine, when called by the
  1617.                           owning/creating class, will create a new instance
  1618.                           memory block and initialize it.  It will update
  1619.                           the Instance object handle pointed to by
  1620.                           ptrToInstanceObjectHandle with the new instance
  1621.                           object handle created.  If the calling class is
  1622.                           not the owner, it will simply dispatch to
  1623.                           getIVptr.  For a better explanation of the use of
  1624.                           this function consult the user's guide.  This is a
  1625.                           public function.
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.                                           23
  1637.  
  1638.  
  1639.                      6. getCVptr
  1640.  
  1641.                           usage:
  1642.  
  1643.                                classVariablesPtr=getCVptr(
  1644.                                                    classObjectHandle);
  1645.  
  1646.                           error value: returns NULL on error.
  1647.  
  1648.                           prototype:
  1649.  
  1650.                                void * getCVptr(object);
  1651.  
  1652.                                This routine will return a pointer to the
  1653.                           class variables area for the class given by
  1654.                           classObjectHandle.  This is a public function.
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.                                           24
  1699.  
  1700.  
  1701.            VI. Pseudo Class Descriptions.
  1702.  
  1703.                      Pseudo classes are code modules which are not part of
  1704.                 the kernel proper, but neither are they true class
  1705.                 definition modules.  These are used for providing both
  1706.                 necessary high level kernel functions and for kernel
  1707.                 expansion.  An additional point is that pseudo classes may
  1708.                 have actual class names and descriptions and they may also
  1709.                 utilize generic functions.
  1710.  
  1711.                      In the basic GCOOPE system there are two linked pseudo
  1712.                 classes; Object and Class.  They and their functions/methods
  1713.                 are described below.
  1714.  
  1715.                 A. Object pseudo class module
  1716.  
  1717.                           This module provides the default routines for the
  1718.                      Generic functions Kill and Err.  It also installs the
  1719.                      Generic function New although it provides no default
  1720.                      for it.  Additional informational 'Smalltalk' style
  1721.                      default functions are defined for the generic
  1722.                      functions: classOf, ivSize, respondsTo, deepCopy, and
  1723.                      shallowCopy.  This module contains eight functions;
  1724.                      Object_Install, kill, err, getClassOf, getIVsize,
  1725.                      defRespondsTo, defDeepCopy, and defShallowCopy.  They
  1726.                      are detailed below.
  1727.  
  1728.  
  1729.                      1. Object_Install
  1730.  
  1731.                           usage:
  1732.  
  1733.                                status=Object_Install();
  1734.  
  1735.                           error value: returns FUNCFAIL on error.
  1736.  
  1737.                           prototype:
  1738.  
  1739.                                stat Object_Install(void);
  1740.  
  1741.                                This routine installs the class 'Object' into
  1742.                           the kernel databases, it also installs the
  1743.                           defaults for the generic functions New, Kill, Err,
  1744.                           classOf, ivSize, respondsTo, deepCopy, and
  1745.                           shallowCopy.  Normally it returns FUNCOKAY.
  1746.  
  1747.                                Although Object is sort of a class, it cannot
  1748.                           be inherited.  Its purpose is to provide the basic
  1749.                           default methods for the kernel.
  1750.                                IMPORTANT NOTE: DO NOT under any
  1751.                           circumstances add methods to the class 'Object'.
  1752.                                This is a public function, however it should
  1753.                           only be called during kernel initialization.
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.                                           25
  1761.  
  1762.  
  1763.                      2. kill
  1764.  
  1765.                           usage:
  1766.  
  1767.                                result=g(Kill)(instanceHandle);
  1768.  
  1769.                           or direct call via:
  1770.  
  1771.                                result=g(Kill)(Object, instanceHandle);
  1772.  
  1773.                           error value: returns NULL on error after calling
  1774.                                               the default error routine.
  1775.  
  1776.                           prototype:
  1777.  
  1778.                                static object kill(object,...);
  1779.  
  1780.                                This routine is the default method for the
  1781.                           Generic function Kill.  It may also be called
  1782.                           explicitly by passing 'Object' as the first method
  1783.                           parameter.  This routine will take the place of a
  1784.                           missing class kill routine as well as actually
  1785.                           killing off the object when all the proper
  1786.                           conditions are met.
  1787.  
  1788.                                When used as a replacement for a missing
  1789.                           class Kill method, it performs the minimum
  1790.                           necessary duties for a class Kill method.  For
  1791.                           each direct parent class of the class for which it
  1792.                           is acting as a replacement routine, it will update
  1793.                           the fext field and call the Kill generic with the
  1794.                           updated object handle.  Thus it will call any
  1795.                           existing ancestor class Kill method.
  1796.  
  1797.                                When it is called explicitly and the fext
  1798.                           field of the second parameter is not zero, it will
  1799.                           simply return a non NULL value.  Else if called
  1800.                           explicitly and the fext field of the second
  1801.                           parameter is zero or if it was called as the
  1802.                           default to replace an owning class Kill method, it
  1803.                           will remove the instance object and free the
  1804.                           instance memory block.
  1805.  
  1806.                                For more information on the Kill generic see
  1807.                           the user's guide.
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.                                           26
  1823.  
  1824.  
  1825.                      3. err
  1826.  
  1827.                           usage:
  1828.  
  1829.                                result=p(Err)(objectHandle,...);
  1830.  
  1831.                           or direct call via:
  1832.  
  1833.                                result=p(Err)(Object, objectHandle,...);
  1834.  
  1835.                           error value: this version aborts at the end of the
  1836.                                      routine and does not return any value.
  1837.  
  1838.                           prototype:
  1839.  
  1840.                                static object err(object,...);
  1841.  
  1842.                                This routine is the default method for the
  1843.                           Generic function Err.  It may also be called
  1844.                           explicitly by passing 'Object' as the first method
  1845.                           parameter.
  1846.  
  1847.                                In the debug version of the kernel, (which
  1848.                           this is) the routine prints all available
  1849.                           information about the error to stderr and them
  1850.                           dumps the last 64 bytes on the stack.  After
  1851.                           printing this information, it aborts.
  1852.  
  1853.  
  1854.                      4. getClassOf
  1855.  
  1856.                           usage:
  1857.  
  1858.                                called via the generic classOf.
  1859.  
  1860.                           error value: (object) 0
  1861.  
  1862.                           prototype:
  1863.  
  1864.                             static object getClassOf(object instance,...);
  1865.  
  1866.                                This is the default function for the classOf
  1867.                           generic.  It returns the class of the passed
  1868.                           instance.  Like all default functions it may be
  1869.                           called explicitly by passing Object as the first
  1870.                           parm with the actual instance as the second parm.
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.                                           27
  1885.  
  1886.  
  1887.                      5. getIVsize
  1888.  
  1889.                           usage:
  1890.  
  1891.                                called via the generic ivSize.
  1892.  
  1893.                           error value: (object) -1
  1894.  
  1895.                           prototype:
  1896.  
  1897.                             static object getIVsize(object instance,...);
  1898.  
  1899.                                This is the default function for the ivSize
  1900.                           generic.  It normally returns the size of the
  1901.                           instance variable structure for a given class cast
  1902.                           as type object.
  1903.  
  1904.  
  1905.                      6. defRespondsTo
  1906.  
  1907.                           usage:
  1908.  
  1909.                                called via the generic respondsTo.
  1910.  
  1911.                           error value: returns (object) NULL.
  1912.  
  1913.                           prototype:
  1914.  
  1915.                             static object defRespondsTo(object instance,...)
  1916.  
  1917.                                This is the default function for the
  1918.                           respondsTo generic.  The parameter following the
  1919.                           actual instance object handle should be of type
  1920.                           generic.  This routine will return the method
  1921.                           address of any existing class method for the
  1922.                           combination of instance and generic.  The return
  1923.                           value is cast as type object.
  1924.  
  1925.  
  1926.                      7. defDeepCopy
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.                                           28
  1947.  
  1948.  
  1949.  
  1950.                           usage:
  1951.  
  1952.                                called via the deepCopy generic.
  1953.  
  1954.                           error value: returns (object) 0 on error.
  1955.  
  1956.                           prototype:
  1957.  
  1958.                             static object defDeepCopy(object instance,...)
  1959.  
  1960.                                This is the default function for the deepCopy
  1961.                           generic.  It will duplicate the instance passed
  1962.                           creating a new instance, copying the instance
  1963.                           block, and returns the handle of the new instance.
  1964.                           Classes which maintain a dynamically allocated
  1965.                           area of memory should define their own methods for
  1966.                           deepCopy that correctly allocate and copy the
  1967.                           dynamic memory area.
  1968.  
  1969.  
  1970.                      8. defShallowCopy
  1971.  
  1972.                           usage:
  1973.  
  1974.                                called via the shallowCopy generic.
  1975.  
  1976.                           error value: returns (object) 0 on error.
  1977.  
  1978.                           prototype:
  1979.  
  1980.                            static object defShallowCopy(object instance,...)
  1981.  
  1982.                                This is the default method for the generic
  1983.                           function shallowCopy.  Immeadiately following the
  1984.                           instance handle should be the source handle.  This
  1985.                           function will only copy the current instance
  1986.                           portion of the source to instance.  It will not
  1987.                           work with instances of class Class, nor will it
  1988.                           work if the class of the current instance of
  1989.                           source is not the owner or an ancestor of the
  1990.                           destination instance - instance.  Normally it
  1991.                           returns the handle to the updated instance.
  1992.                               As with deepCopy above, special care needs to
  1993.                           be taken with classes that manage dynamic memory
  1994.                           or other system resources.
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.                                           29
  2009.  
  2010.  
  2011.                 B. Class pseudo-class module.
  2012.  
  2013.                           This module provides the means for the
  2014.                      installation and initialization of class definitions
  2015.                      and forms the primary interface for those definitions.
  2016.                      It should be installed after Object and prior to any
  2017.                      other pseudo-classes or class definitions.  Although
  2018.                      Class actually is a true class, its inclusion of normal
  2019.                      functions and use of low level kernel functions makes
  2020.                      it a pseudo-class.  Additionally, Class is the one
  2021.                      class that cannot be inherited, or at least, I can't
  2022.                      think of any reason why you would want to.
  2023.  
  2024.                        This module contains six functions/methods; inhMthd,
  2025.                      newClass, addGMthd, rmvGMthd, killClass, and
  2026.                      Class_Install.  These are defined below.
  2027.  
  2028.  
  2029.                      1. inhMthd
  2030.  
  2031.                           usage:
  2032.  
  2033.                                status=inhMthd(classObjectHandle,
  2034.                                                    superClassObjectHandle);
  2035.  
  2036.                           error value: returns FUNCFAIL on error.
  2037.  
  2038.                           prototype:
  2039.  
  2040.                                int inhMthd(object, object);
  2041.  
  2042.                                This routine causes the class given by
  2043.                           classObjectHandle to inherit all of the methods
  2044.                           for superClassObjectHandle.  It normally returns
  2045.                           FUNCOKAY.
  2046.  
  2047.                                The main use of this function is its direct
  2048.                           use by newClass to inherit the methods of ancestor
  2049.                           classes, however, it is provided as a Generic
  2050.                           method for potential use by pseudo class modules
  2051.                           that add functionality to existing class
  2052.                           definitions.  This is a postulated possibility,
  2053.                           not a foreseen one.  It does however, present an
  2054.                           alternative method of class definition expansion.
  2055.                           Most likely this will end up on the
  2056.                           forgotten/unnecessary public function list.
  2057.                           However, this is a public function.
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.                                           30
  2071.  
  2072.  
  2073.                      2. newClass
  2074.  
  2075.                           usage:
  2076.  
  2077.                                myNewClass=p(New)(Class,"myNewClass",
  2078.                                          sizeofCVs,sizeofIVs, parent1,...
  2079.                                          parentx, END);
  2080.  
  2081.                           error value: returns END on error.
  2082.  
  2083.                           prototype:
  2084.  
  2085.                                static object newClass(object,char *,
  2086.                                                              int,int,...);
  2087.  
  2088.                                This is the method for genmorph New when the
  2089.                           first method parameter is Class.  It creates a new
  2090.                           class object, adding the name to the symbol list,
  2091.                           creating the class definition memory block,
  2092.                           initializing the block, adding the object to the
  2093.                           object list, inheriting all of the ancestor
  2094.                           classes in the parent list which is terminated by
  2095.                           END, and setting up the instance memory tracking
  2096.                           system for instances of the new class.
  2097.  
  2098.                                Normally it returns the object handle of the
  2099.                           new class object.  This method is a necessary part
  2100.                           of a class definition's installation procedure.
  2101.                           More detail on its use appears in the user's
  2102.                           guide.
  2103.  
  2104.  
  2105.                      3. addGMthd
  2106.  
  2107.                           usage:
  2108.  
  2109.                                status=addGMthd(objectHandleOfClass,
  2110.                                          GenericFunctionStringName,
  2111.                                                    addressOfNewMethod);
  2112.  
  2113.                           error value: returns FUNCFAIL on error.
  2114.  
  2115.                           prototype:
  2116.  
  2117.                                int addGMthd(object, char *, method);
  2118.  
  2119.                                This adds a new method to the named generic
  2120.                           function for the indicated class.  If the named
  2121.                           generic function does not exist, it will be
  2122.                           created.  Under normal conditions it returns
  2123.                           FUNCOKAY.  This is a public function.
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.                                           31
  2133.  
  2134.  
  2135.                      4. rmvGMthd
  2136.  
  2137.                           usage:
  2138.  
  2139.                                status=rmvGMthd(objectHandleOfClass,
  2140.                                     GenericFunctionStringName);
  2141.  
  2142.                           error value: returns FUNCFAIL on error.
  2143.  
  2144.                           prototype:
  2145.  
  2146.                                int rmvGMthd(object, char *);
  2147.  
  2148.                                This routine removes a class method from the
  2149.                           named Generic function.  Under normal conditions
  2150.                           it returns FUNCOKAY.  This is a public function.
  2151.  
  2152.  
  2153.                      5. killClass
  2154.  
  2155.                           usage:
  2156.  
  2157.                                result=p(Kill)(Class, classToKill);
  2158.  
  2159.                           error value: returns FUNCFAIL on error.
  2160.  
  2161.                           prototype:
  2162.  
  2163.                                static object killClass(object, object);
  2164.  
  2165.                                This method for Class kills a class object
  2166.                           given by classToKill.  It will remove all class
  2167.                           methods.  This feature is of limited use until a
  2168.                           dynamic loader add on module is defined.  Normally
  2169.                           this method returns FUNCOKAY.
  2170.  
  2171.  
  2172.                      6. Class_Install
  2173.  
  2174.                           usage:
  2175.  
  2176.                                status=Class_Install();
  2177.  
  2178.                           error value: returns FUNCFAIL on error.
  2179.  
  2180.                           prototype:
  2181.  
  2182.                                int Class_Install(void);
  2183.  
  2184.                                This installs the class 'Class' and adds
  2185.                           newClass and killClass to their respective Generic
  2186.                           functions.  Normally this routine returns
  2187.                           FUNCOKAY.  Although this is a public function, it
  2188.                           should only be called during initialization.
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.                                           32
  2195.  
  2196.  
  2197.            VII. Summary
  2198.  
  2199.                      The story of GCOOPE is far from complete, although the
  2200.                 above described kernel functions, modules, and pseudo
  2201.                 classes do form a self sufficient core that can be used to
  2202.                 write programs without any additional modules except for
  2203.                 user defined class definitions and an initialization
  2204.                 routine.
  2205.  
  2206.                      Additions to the kernel such as a dynamic loader pseudo
  2207.                 class module, a multi-tasker pseudo class module, etc. will
  2208.                 have their own separate documents.  So this technical
  2209.                 reference manual is complete for version 1.0 as it stands
  2210.                 now.  The above material is presented primarily for the
  2211.                 programmer who wants to either expand the kernel, introduce
  2212.                 speed up routines, or otherwise modify it.  Any
  2213.                 modifications should preserve the given prototypes and
  2214.                 interface for public and Generic functions for compatibility
  2215.                 reasons.
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.                                           33
  2257.  
  2258.  
  2259.            Appendix A. Appendix A.  User's group Information.
  2260.  
  2261.  
  2262.                           JOIN THE GCOOPE USER'S GROUP!
  2263.  
  2264.  
  2265.                 For a one year membership send check/money order in the
  2266.                 amount of $20.00, (made payable to Brian Lee Price) to the
  2267.                 address below:
  2268.  
  2269.                           Brian Lee Price
  2270.  
  2271.                           GCOOPE USERS GROUP
  2272.  
  2273.                           RD2 BOX239AA
  2274.  
  2275.                           CLEARVILLE, PA.  15535
  2276.  
  2277.                     Please include my middle name to avoid local post office
  2278.                     difficulties :).
  2279.  
  2280.  
  2281.                      User's group members receive the latest updates to the
  2282.                 GCOOPE system, new class libraries, expansion modules, etc.
  2283.                 Limited (5hrs/yr) free technical support over the phone is
  2284.                 available, and access is granted to a User's group only
  2285.                 private limited access bbs, you will be added to the
  2286.                 quarterly newsletter mailing list, and other services are
  2287.                 available.
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.                                           34
  2319.  
  2320.  
  2321.            Appendix B. Appendix B.  Developer's notes to GCOOPE 1.0
  2322.  
  2323.                     This package is primarily intended for experimental,
  2324.                 exploratory, and educational purposes.  It encorporates a
  2325.                 Smalltalk like framework in a standard ANSI C compatible
  2326.                 manner.  GCOOPE is the upgraded and revamped child of the
  2327.                 PCOOPE package.  While similar in operation to its ancestor,
  2328.                 GCOOPE provides a more programmer friendly environment and
  2329.                 has much improved capabilities.
  2330.  
  2331.                     In the first release of the ancestor package, I made
  2332.                 some claims and misleading statements which while
  2333.                 unintentional, have given me cause to regret.  The ancestor
  2334.                 package ended up reaching entirely the wrong audience, I was
  2335.                 being contacted by professional programmers and commercial
  2336.                 interests who believed it to be applicable to mainstream
  2337.                 programming.  Unfortunately, my limited experience and lack
  2338.                 of resources makes it currently impossible for me to develop
  2339.                 the framework into its full potential as a commercial
  2340.                 product.
  2341.  
  2342.                     GCOOPE and its ancestors are my learning environment for
  2343.                 object oriented programming.  As I write and modify the
  2344.                 package, I continually find new capabilities and alternate
  2345.                 approaches that were not purposely designed into the
  2346.                 package.  GCOOPE has been designed to be a modular,
  2347.                 extensible, and easy to maintain package that offers as much
  2348.                 flexibility as possible within its chosen approach to object
  2349.                 oriented programming.
  2350.  
  2351.                     You will find that the basic class library included in
  2352.                 the package is full of experimental and exploratory
  2353.                 approaches.  This is because I am learning OOP and GCOOPE as
  2354.                 I write them.  Prior to my involvement with the ancestor
  2355.                 package, I had no experience in OOP.  Many of the
  2356.                 improvements embodied in GCOOPE have come as a direct result
  2357.                 of feedback from user's group members, in particular Norman
  2358.                 Culver, and Mark Murphy.  It is hoped that future user's
  2359.                 group members will provide a similar service for the GCOOPE
  2360.                 package.
  2361.  
  2362.                     GCOOPE is not intended as a competitive alternative to
  2363.                 C++, Smalltalk, or other commercial OOP approaches.  It is
  2364.                 ludicrous to assume that one person working alone with a
  2365.                 student's budget and only a year's experience in C
  2366.                 programming could develop and support a full fledged
  2367.                 commercial programming environment.  However I do believe
  2368.                 that GCOOPE is suitable as an educational/experimental
  2369.                 environment for exploring various topics in OOP.
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.                                           35
  2381.  
  2382.  
  2383.                     Technical support and upgrades are available only
  2384.                 through the GCOOPE user's group.  In the works are speed up
  2385.                 routines for the kernel functions, including platform
  2386.                 dependant inline assembly optimizations, multi-tasking with
  2387.                 threads, pipes, etc., primitive GUI class libraries, and
  2388.                 dynamic loading support.  Currently, I am limited to the
  2389.                 IBM-PC hardware platform with MS-DOS, however, I will be
  2390.                 more than happy to assist any user's group member with ports
  2391.                 of the package to Unix, Atari ST, MAC, etc.  In fact, if you
  2392.                 are SERIOUS about doing the port, I'll throw in a free
  2393.                 year's membership.  I would also be interested in
  2394.                 co-operating with other programmers in the development of a
  2395.                 commercial version of the GCOOPE framework, however to
  2396.                 qualify you must be able to provide information and
  2397.                 capabilities beyond what I have locally.
  2398.  
  2399.                     To summarize, GCOOPE is an educational and experimental
  2400.                 approach to providing OOP in an ANSI C environment.  It
  2401.                 attempts to mix Smalltalk like features with the power of
  2402.                 standard C.  While I have tried to keep the system
  2403.                 compatible with C++, it is a different approach to OOP than
  2404.                 that provided by C++.  This package is intended primarily
  2405.                 for students of OOP and C, although anyone is welcome to use
  2406.                 it for commercial purposes as they see fit (just send me a
  2407.                 job application form!).
  2408.  
  2409.                      Thank you for examining GCOOPE, please pass it on,
  2410.                 thank you.
  2411.  
  2412.                                          Sincerely,
  2413.  
  2414.                                                    Brian L. Price
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.                                           36
  2443. 
  2444.